class MovePageForm {
var $oldTitle, $newTitle, $reason; # Text input
var $moveTalk, $deleteAndMove;
-
+
function MovePageForm( $par ) {
global $wgRequest;
$target = isset($par) ? $par : $wgRequest->getVal( 'target' );
$this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true );
$this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' );
}
-
+
function showForm( $err ) {
global $wgOut, $wgUser;
return;
}
$oldTitle = $ot->getPrefixedText();
-
+
$encOldTitle = htmlspecialchars( $oldTitle );
if( $this->newTitle == '' ) {
# Show the current title as a default
}
$moveTalkChecked = $this->moveTalk ? ' checked="checked"' : '';
-
+
$wgOut->addHTML( "
<form id=\"movepage\" method=\"post\" action=\"{$action}\">
<table border='0'>
function doSubmit() {
global $wgOut, $wgUser, $wgRequest;
$fname = "MovePageForm::doSubmit";
-
+
if ( $wgUser->pingLimiter( 'move' ) ) {
$wgOut->rateLimited();
return;
}
-
+
# Variables beginning with 'o' for old article 'n' for new article
$ot = Title::newFromText( $this->oldTitle );
}
wfRunHooks( 'SpecialMovepageAfterMove', array( &$this , &$ot , &$nt ) ) ;
-
+
# Move talk page if
# (1) the checkbox says to,
# (2) the namespaces are not themselves talk namespaces, and of course
if ( ( $wgRequest->getVal('wpMovetalk') == 1 ) &&
!$ot->isTalkPage() &&
!$nt->isTalkPage() ) {
-
+
$ott = $ot->getTalkPage();
$ntt = $nt->getTalkPage();
# Stay silent on the subject of talk.
$talkmoved = '';
}
-
+
# Give back result to user.
$titleObj = Title::makeTitle( NS_SPECIAL, 'Movepage' );
$success = $titleObj->getFullURL(
$talkmoved = $wgRequest->getVal('talkmoved');
$text = wfMsg( 'pagemovedtext', $oldtitle, $newtitle );
-
+
# Temporarily disable raw html wikitext option out of XSS paranoia
$marchingantofdoom = $wgRawHtml;
$wgRawHtml = false;